package Day2025_04_09;

import java.util.*;

public class Demo06 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt();
        Map<Integer, List<Integer>> map = new HashMap<>();
        // 建图
        for (int i = 0; i < m; i++) {
            int n1 = sc.nextInt(), n2 = sc.nextInt();
            if (!map.containsKey(n1)) map.put(n1, new ArrayList<>());
            map.get(n1).add(n2);
        }

        Queue<Integer> queue = new PriorityQueue<>();
        // 怎么添加第一个数?????
    }
}
